package cn.lut.springboot.web;

import cn.lut.springboot.config.Abc;
import cn.lut.springboot.config.School;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

/**
 * @user:dell
 * @date:2020年12月30 22:21
 */
@Controller
public class IndexController {
    @Autowired
    private School school;
    @Autowired
    private Abc abc;
    @RequestMapping(value = "/say")
    @ResponseBody
    public String say(){
        return "学校名称"+school.getName()+""+"学校网址"+school.getWebsit()+"个人名称"+abc.getName()+"个人网站"+abc.getWebsit();
    }
    @RequestMapping(value = "/test")
    public ModelAndView say1(){
        ModelAndView mv=new ModelAndView();
        mv.addObject("message","hello i am xhy");
        mv.setViewName("say");
        return mv;
    }
}
